﻿<phone:PhoneApplicationPage x:Class="SAFPodcast.WP8.AddFeedView"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
  xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  xmlns:converters="clr-namespace:SAFPodcast.WP8.Fwk.Converter;assembly=SAFPodcast.WP8.Fwk"
  xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
  xmlns:ignore="http://www.ignore.com"
  mc:Ignorable="d ignore"
  d:DesignWidth="480"
  d:DesignHeight="696"
  FontFamily="{StaticResource PhoneFontFamilyNormal}"
  FontSize="{StaticResource PhoneFontSizeNormal}"
  Foreground="{StaticResource PhoneForegroundBrush}"
  SupportedOrientations="Portrait"
  Orientation="Portrait"
  shell:SystemTray.IsVisible="True"
  DataContext="{Binding AddFeed, Source={StaticResource Locator}}">

  <Grid x:Name="LayoutRoot"
          Background="Transparent">
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto" />
      <RowDefinition Height="*" />
    </Grid.RowDefinitions>

    <StackPanel x:Name="TitlePanel"
                    Grid.Row="0"
                    Margin="12,17,0,28">
      <TextBlock x:Name="ApplicationTitle"
                       Text="{Binding Path=Global.AddFeed_Title, Source={StaticResource LocalizedStrings}}"
                       Style="{StaticResource PhoneTextNormalStyle}" />
    </StackPanel>

    <Grid x:Name="ContentPanel"
              Grid.Row="1"
              Margin="12,0,12,0">
      <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="Auto" />
        <RowDefinition Height="Auto" />
      </Grid.RowDefinitions>
      <StackPanel Grid.Row="0" Margin="12,0" Orientation="Vertical">
        <TextBlock Text="URL" FontSize="{StaticResource PhoneFontSizeNormal}" FontFamily="{StaticResource PhoneFontFamilyNormal}" VerticalAlignment="Top" LineHeight="31" LineStackingStrategy="BlockLineHeight" Foreground="{StaticResource PhoneSubtleBrush}" TextWrapping="Wrap" Margin="12,0,12,-5" />
        <TextBox Text="{Binding UrlAsString, Mode=TwoWay, UpdateSourceTrigger=Explicit}"
               TextWrapping="Wrap" TextChanged="TextBox_TextChanged" />
      </StackPanel>
      <Button Grid.Row="1" Content="Test Feed" Command="{Binding TestFeed}" />
      <TextBlock Grid.Row="2" Text="{Binding TestResult}" FontSize="{StaticResource PhoneFontSizeNormal}" FontFamily="{StaticResource PhoneFontFamilyNormal}" VerticalAlignment="Top" LineHeight="31" LineStackingStrategy="BlockLineHeight" Foreground="{StaticResource PhoneSubtleBrush}" TextWrapping="Wrap" Margin="12,0,12,-5"></TextBlock>
    </Grid>

    <StackPanel Visibility="Collapsed">
      <Button x:Name="btnAdd" Visibility="Collapsed"
          Content="Invisible" Command="{Binding AddHidden}" />
      <Button x:Name="btnCancel" Visibility="Collapsed"
          Content="Invisible" Command="{Binding CancelHidden}" />
        </StackPanel>
    </Grid>

    <toolkit:TransitionService.NavigationInTransition>
        <toolkit:NavigationInTransition>
            <toolkit:NavigationInTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardIn"/>
            </toolkit:NavigationInTransition.Backward>
            <toolkit:NavigationInTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardIn"/>
            </toolkit:NavigationInTransition.Forward>
        </toolkit:NavigationInTransition>
    </toolkit:TransitionService.NavigationInTransition>
    <toolkit:TransitionService.NavigationOutTransition>
        <toolkit:NavigationOutTransition>
            <toolkit:NavigationOutTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardOut"/>
            </toolkit:NavigationOutTransition.Backward>
            <toolkit:NavigationOutTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardOut"/>
            </toolkit:NavigationOutTransition.Forward>
        </toolkit:NavigationOutTransition>
    </toolkit:TransitionService.NavigationOutTransition>

    <phone:PhoneApplicationPage.ApplicationBar>
    <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
      <shell:ApplicationBarIconButton x:Name="abbAdd" IconUri="/Toolkit.Content/appbar.add.rest.png" Text="Save" Click="abbAdd_Click" />
      <shell:ApplicationBarIconButton x:Name="abbCancel" IconUri="/Toolkit.Content/appbar.cancel.rest.png" Text="Cancel" Click="abbCancel_Click" />
    </shell:ApplicationBar>
  </phone:PhoneApplicationPage.ApplicationBar>
</phone:PhoneApplicationPage>
